CONTROL_PARENT = AOSS_LOCAL_STRINGS.CONTROLS_NAME

local L = AOSS_LOCAL_STRINGS

function AOSSControls_OnLoad(frame)
	_G[frame:GetName().."Text"]:SetText(L.CONTROLS_PANEL_TEXT)
	frame.name = CONTROL_PARENT
	AOSS_AddCategory(frame)
end

function UIDropDownMenu_DefaultLoad(self, width, init_func)
	local value = 1;

	self.value = value;
	self.defaultValue = 1;
	self.restart = true;		

   UIDropDownMenu_SetWidth(self, width);
   UIDropDownMenu_Initialize(self, init_func);
   UIDropDownMenu_SetSelectedID(self, value, 1);
   
   self.SetValue = 
		function (self, value) 
			self.value = value;
		end;
	self.GetValue =
		function (self)			
			return self.value;
		end
	self.RefreshValue = 
		function (self)			
			local value = 1;
			UIDropDownMenu_Initialize(self, init_func);
			UIDropDownMenu_SetSelectedID(self, value, 1);
			self.value = value;
			self.newValue = value;
		end
end

function UIDropDownMenu_AddButtons(infos, func)
	local info;	
	for i = 1, #infos do				
		info = UIDropDownMenu_CreateInfo();
		info.text = infos[i];
		info.func = func;
		UIDropDownMenu_AddButton(info);		
	end
end

